﻿using RimWorld;
using System.Collections.Generic;
using UnityEngine;
using Verse;

namespace RI_Talisman
{
    internal class RI_Projectile_SwordCharm : Projectile
    {
        public override bool AnimalsFleeImpact => true;

        protected override void Impact(Thing hitThing, bool blockedByShield = false)
        {
            Map map = base.Map;
            base.Impact(hitThing, blockedByShield);
            GenExplosion.DoExplosion(base.Position, map, def.projectile.explosionRadius, DamageDefOf.Stun, launcher, DamageAmount, ArmorPenetration, null, equipmentDef, def, postExplosionSpawnThingDef: null, intendedTarget: intendedTarget.Thing, postExplosionSpawnChance: 0.2f, postExplosionSpawnThingCount: 1, postExplosionGasType: null, applyDamageToExplosionCellsNeighbors: false, preExplosionSpawnThingDef: null, preExplosionSpawnChance: 0f, preExplosionSpawnThingCount: 1, chanceToStartFire: 0f);
            GenExplosion.DoExplosion(base.Position, map, def.projectile.explosionRadius, DamageDefOf.EMP, launcher, DamageAmount, ArmorPenetration, null, equipmentDef, def, postExplosionSpawnThingDef: ThingDefOf.Filth_Ash, intendedTarget: intendedTarget.Thing, postExplosionSpawnChance: 0.2f, postExplosionSpawnThingCount: 1, postExplosionGasType: null, applyDamageToExplosionCellsNeighbors: false, preExplosionSpawnThingDef: null, preExplosionSpawnChance: 0f, preExplosionSpawnThingCount: 1, chanceToStartFire: 0f);
            GenExplosion.DoExplosion(base.Position, map, def.projectile.explosionRadius, DamageDefOf.Bomb, launcher, DamageAmount, ArmorPenetration, null, equipmentDef, def, postExplosionSpawnThingDef: ThingDefOf.Filth_Dirt, intendedTarget: intendedTarget.Thing, postExplosionSpawnChance: 0.2f, postExplosionSpawnThingCount: 1, postExplosionGasType: null, applyDamageToExplosionCellsNeighbors: false, preExplosionSpawnThingDef: null, preExplosionSpawnChance: 0f, preExplosionSpawnThingCount: 1, chanceToStartFire: 0f);
            GenSpawn.Spawn(RI_T_DefOfs.DropSword, base.Position, map);
        }
    }
}
